<!DOCTYPE html>
<html lang="en">
  <head>
    <title>MonkeyPaws Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/MonkeyPaws" class="dashAnchor"></a>
    <a title="MonkeyPaws Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html"> Docs</a> (75% documented)</p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html"> Reference</a>
        <img id="carat" src="../img/carat.png" />
        MonkeyPaws Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/MonkeyPaws.html">MonkeyPaws</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/CGRect.html">CGRect</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>MonkeyPaws</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">MonkeyPaws</span><span class="p">:</span> <span class="kt">NSObject</span><span class="p">,</span> <span class="kt">CALayerDelegate</span></code></pre>

                </div>
              </div>
            <p>A class that visualises input events as an overlay over
your regular UI. To use, simply instantiate it and
keep a reference to it around so that it does not get
deinited.</p>

<p>You will want to have some way to only instantiate it
for test usage, though, such as adding a command-line
flag to enable it.</p>

<p>Example usage:</p>

<pre class="highlight plaintext"><code>var paws: MonkeyPaws?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&gt; Bool {
    if CommandLine.arguments.contains("--MonkeyPaws") {
        paws = MonkeyPaws(view: window!)
    }
    return true
}
</code></pre>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC15SwiftMonkeyPaws10MonkeyPawscFT4viewCSo6UIView16tapUIApplicationSb_S0_"></a>
                    <a name="//apple_ref/swift/Method/init(view:tapUIApplication:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC15SwiftMonkeyPaws10MonkeyPawscFT4viewCSo6UIView16tapUIApplicationSb_S0_">init(view:tapUIApplication:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a MonkeyPaws object that will visualise input
events.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">tapUIApplication</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>view</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The view to put the visualisation layer in. Usually, you will want to pass your main <code>UIWindow</code> here.</p>

                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>tapUIApplication</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>By default, MonkeyPaws will swizzle some methods in UIApplication to intercept events so that it can visualise them. If you do not want this, pass <code>false</code> here and provide it with events manually.</p>

                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FC15SwiftMonkeyPaws10MonkeyPaws6appendFT5eventCSo7UIEvent_T_"></a>
                    <a name="//apple_ref/swift/Method/append(event:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:FC15SwiftMonkeyPaws10MonkeyPaws6appendFT5eventCSo7UIEvent_T_">append(event:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>If you have disabled UIApplication event tapping,
use this method to pass in <code>UIEvent</code> objects to
visualise.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">append</span><span class="p">(</span><span class="nv">event</span><span class="p">:</span> <span class="kt">UIEvent</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2016 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2016-11-28)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
